package com.example.zhangyu.loadingapplication;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Toast;


/**
 * Created by Jack Wang on 2016/8/5.
 */

public class DaojishiActivity extends AppCompatActivity{

    private CountdownView mCountdownView;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_daojishi);

        mCountdownView = (CountdownView) findViewById(R.id.countdown);
        mCountdownView.setText("倒计时");
        mCountdownView.setTime(5000);
        mCountdownView.star();
        mCountdownView.setOnFinishAction(new Action() {
            @Override
            public void onAction() {
                Toast.makeText(DaojishiActivity.this,"结束",Toast.LENGTH_SHORT).show();
            }
        });
        mCountdownView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Toast.makeText(DaojishiActivity.this,"点击",Toast.LENGTH_SHORT).show();
            }
        });
    }

}
